package com.glc.lpp.simulation.res;

/**
 * 资源
 *
 * @author demo
 * @version 2017-05-14
 */
public class Resource {

    /**
     * 名称
     */
    private final String name;

    /**
     * 资源数量
     */
    public final int originalAvailable;
    /**
     * 资源数量
     */
    public int available;

    public Resource(String name, int available) {
        this.name = name;
        this.available = available;
        this.originalAvailable = available;
    }

    public void use(int amount) {
        available -= amount;
    }

    public void restore(int amount) {
        available += amount;
    }

    public int getAvailable() {
        return available;
    }

    public String getName() {
        return name;
    }
}
